package net.lijingye.education.entity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * Created by LijingYe on 2016/4/5.
 */
@Entity
@Table(name = "student_assignment")
public class StudentAssignment implements Serializable {
    @Id
    @OneToOne
    @JoinColumn(name = "userId")
    private User user;
    @Id
    @OneToOne
    @JoinColumn(name = "assignmentId")
    private Assignment assignment;
    @Column(name = "time")
    private Date time;
    @Column(name = "count")
    private int count;
    @Column(name = "filePath")
    private String myAnswer;

    public StudentAssignment() {
    }

    public StudentAssignment(User user, Assignment assignment, Date time, int count, String myAnswer) {
        this.user = user;
        this.assignment = assignment;
        this.time = time;
        this.count = count;
        this.myAnswer = myAnswer;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Assignment getAssignment() {
        return assignment;
    }

    public void setAssignment(Assignment assignment) {
        this.assignment = assignment;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public String getMyAnswer() {
        return myAnswer;
    }

    public void setMyAnswer(String myAnswer) {
        this.myAnswer = myAnswer;
    }
}
